#ifndef _SGX_SPINLOCK_H_
#define _SGX_SPINLOCK_H_

#include "sgx_defs.h"
#include <stdint.h>

typedef volatile uint32_t sgx_spinlock_t;

#define SGX_SPINLOCK_INITIALIZER 0

#if defined(__cplusplus)
extern "C" {
#endif

uint32_t SGXAPI sgx_spin_lock(sgx_spinlock_t *lock);
uint32_t SGXAPI sgx_spin_unlock(sgx_spinlock_t *lock);

#if defined(__cplusplus)
}
#endif

#endif /* !_SGX_SPINLOCK_H_ */